<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let num1 = prompt(`1、输入 + - * / 计算两个数字的结果
         2、如果输入q则是退出`);
        if (num1 !== 'q') {
            let num2 = +prompt('请输入第一个数字');
            let num3 = +prompt('请输入第二个数字');
            if (num1 == '+') {
                alert(num2 + num3);
            } else if (num1 == '-') {
                alert(num2 - num3);
            } else if (num1 == '*') {
                alert(num2 * num3);
            } else if (num1 == '/') {
                alert(num2 / num3);
            }
        } else {
            alert('已退出');
        };


    </script>
</body>

</html>